package com.dhl.factory.simplefactory.order;

import com.dhl.factory.simplefactory.pizza.CheessPizza;
import com.dhl.factory.simplefactory.pizza.ChinaPizza;
import com.dhl.factory.simplefactory.pizza.GreekPizza;
import com.dhl.factory.simplefactory.pizza.Pizza;

/**
 * @title: SimpleFactory
 * @Author danghailiang
 * @Date: 2022/7/26 21:38
 * @Version 1.0
 */
public class SimpleFactory {

    public static Pizza getPizza(String type) {
        Pizza pizza = null;
        if (type.equals("中国披萨")) {
            pizza = new ChinaPizza("中国披萨");
        } else if (type.equals("芝士披萨")) {
            pizza = new CheessPizza("芝士披萨");
        } else if (type.equals("希腊披萨")) {
            pizza = new GreekPizza("希腊披萨");
        }
        return pizza;
    }
}
